const isPowerOf2 = (num) => {
  let temp = 1;
  while (temp <= num) {
    if (temp === num) {
      return true;
    }
    temp = temp * 2;
  }
  return false;
}
const isPowerOf2V2 = (num) => {
  let temp = 1;
  while (temp <= num) {
    if (temp === num) {
      return true;
    }
    temp = temp << 1;
  }
  return false;
}
const isPowerOf2V3 = (num) => {
  return (num & num - 1) === 0;
}

